/*******************************************************************************
 * This file is part of blueprint4j www.blueprint4j.org.
 * 
 *     blueprint4j is free software: you can redistribute it and/or modify
 *     it under the terms of the GNU Lesser General Public License as published by
 *     the Free Software Foundation, either version 3 of the License, or
 *     (at your option) any later version.
 * 
 *     blueprint4j is distributed in the hope that it will be useful,
 *     but WITHOUT ANY WARRANTY; without even the implied warranty of
 *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *     GNU Lesser General Public License for more details.
 * 
 *     You should have received a copy of the GNU Lesser General Public License
 *     along with blueprint4j. If not, see <http://www.gnu.org/licenses/>.
 ******************************************************************************/
package blueprint4j.db;

import blueprint4j.Constants;


public class FieldGroupContact extends FieldGroup {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	public FieldGroup contact;
	public FieldString first_name;
	public FieldString middle_name;
	public FieldString last_name;
	public FieldString title;
	public FieldString role;
	public FieldString phone;
	public FieldString fax;
	public FieldString mobile;
	public FieldString email;

	public FieldGroupContact(String name,String prefix,Entity entity) {
		this(name,prefix,entity,true);
	}
	
	public FieldGroupContact(String name,String prefix,Entity entity,boolean make_name_field) {
		super(name,Constants.ICON_BASE+"actions/identity.png",entity);
		if (prefix==null){
			prefix="";
		}
		if (prefix.length()>0){
			prefix=prefix+"_";
		}
		first_name = new FieldString(prefix+"contact_first", (make_name_field?Field.FIELD_NAME:0), "First", 30,entity);
		middle_name = new FieldString(prefix+"contact_middle", 0, "Middle", 30,entity);
		last_name = new FieldString(prefix+"contact_last", (make_name_field?Field.FIELD_NAME:0), "Last", 30,entity);
		title = new FieldString(prefix+"contact_title", 0, "Title", 5,entity);
		role = new FieldString(prefix+"contact_role", 0, "Role", 50,entity);
		phone = new FieldString(prefix+"contact_phone", 0, "Phone", 20,entity);
		fax = new FieldString(prefix+"contact_fax", 0, "Fax", 20,entity);
		mobile = new FieldString(prefix+"contact_mobile", 0, "Mobile",15, entity);
		email = new FieldString(prefix+"contact_email", 0, "Email", 50,entity);
	}
}

